onmessage = function (event) {
    let param = event.data;
    switch (param.cmd) {
        case 'time':
            postMessage({ cmd: 'time', data: new Date() })
            break;
    }
}